//
//  RecommendCell.m
//  cm
//
//  Created by suyibaishan on 2017/11/4.
//  Copyright © 2017年 feihu. All rights reserved.
//

#import "RecommendCell.h"

@implementation RecommendCell

-(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        [self constructUI];
    }
    return self;
}

-(void)constructUI
{
    UIView *view = [[UIView alloc] initWithFrame:CGRectMake(10, 0, kScreenWidth - 20, 40)];
    view.layer.borderWidth = 0.5;
    view.layer.borderColor = [UIColor colorWithRed:0.9 green:0.9 blue:0.9 alpha:1].CGColor;
    [self.contentView addSubview:view];

    UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(10, 10, 20, 20)];
//    imageView.layer.cornerRadius = 5;
//    imageView.contentMode = UIViewContentModeScaleAspectFill;
//    imageView.clipsToBounds = YES;
    imageView.image = [UIImage imageNamed:@"usercopy"];
    [view addSubview:imageView];
    
    _titleLabel = [[UILabel alloc] init];
    _titleLabel.textColor = [UIColor colorWithRed:0.19 green:0.53 blue:0.98 alpha:1];
//    titleLabel.text = @"张良";
    _titleLabel.font = [UIFont systemFontOfSize:14];
    [view addSubview:_titleLabel];
    _titleLabel.sd_layout
    .leftSpaceToView(imageView, 10)
    .topSpaceToView(view, 7.5)
    .widthIs(kScreenWidth/2)
    .heightIs(25);
    
    _timeLabel = [[UILabel alloc] init];
    _timeLabel.textColor = [UIColor blackColor];
//    timeLabel.text = @"加入时间:2017/11/11";
    _timeLabel.textAlignment = NSTextAlignmentRight;
    _timeLabel.font = [UIFont systemFontOfSize:11];
    [view addSubview:_timeLabel];
    _timeLabel.sd_layout
    .rightSpaceToView(view, 10)
    .topSpaceToView(view, 7.5)
    .widthIs(kScreenWidth/2)
    .heightIs(25);
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
